package com.woniuxy.servcie.impl;

import com.woniuxy.dao.RbacManagerPermDao;
import com.woniuxy.entity.RbacManagerPerm;
import com.woniuxy.servcie.RbacManagerPermServcie;

import java.util.List;

/**
 * @author 佘赛飞
 * @create 2021 -11 -16 9:19 PM
 */
public class RbacManagerPermServcieImpl implements RbacManagerPermServcie {

    RbacManagerPermDao rbacManagerPermDao;

    public RbacManagerPermDao getRbacManagerPermDao() {
        return rbacManagerPermDao;
    }

    public void setRbacManagerPermDao(RbacManagerPermDao rbacManagerPermDao) {
        this.rbacManagerPermDao = rbacManagerPermDao;
    }

    public List<RbacManagerPerm> findAll() {
        List<RbacManagerPerm> list = rbacManagerPermDao.findAll();
        for (RbacManagerPerm rbacManagerPerm : list) {
            System.out.println(rbacManagerPerm);
        }
        return null;
    }

    public void addManagerPerm() {
        RbacManagerPerm rbacManagerPerm = new RbacManagerPerm(3, 2);
        rbacManagerPermDao.addManagerPerm(rbacManagerPerm);
    }

    public void delManagerPerm() {
        RbacManagerPerm rbacManagerPerm = new RbacManagerPerm(1, 2);
        rbacManagerPermDao.delManagerPerm(rbacManagerPerm);
    }

    public void upData() {
        RbacManagerPerm rbacManagerPerm = new RbacManagerPerm();
        rbacManagerPermDao.upData(rbacManagerPerm, 3, 6);
    }
}
